package com.vlin.api.mq.client;

import java.util.function.BiConsumer;

import org.apache.pulsar.client.api.Consumer;

import com.vlin.api.mq.config.MessageHandlerTask;
import com.vlin.api.mq.utils.PulsarConsumerPoolFactory;
import com.vlin.api.mq.utils.ThreadPoolFactory;

public class VlinConsumer {

	public static void main(String[] args) throws Exception {
		
        PulsarConsumerPoolFactory.getConsumerPool().forEach(new BiConsumer<Integer, Consumer>() {
            @Override
            public void accept(Integer consumerNum, Consumer consumer) {
                ThreadPoolFactory.getCustomThreadPool().submit(new MessageHandlerTask(consumerNum, consumer));
            }
        });
    }
}
